#!/usr/bin/env python3

import sys
import pygame

def main(argv):
    pygame.init()

    pygame.display.set_mode((600, 480))

    while True:
        e = pygame.event.wait()
        if e.type == pygame.QUIT:
            break
        elif e.type == pygame.MOUSEMOTION:
            print('pos = ', e.pos)
        elif e.type == pygame.MOUSEBUTTONDOWN:
            print("button: ", e.button, ", pos = ", e.pos)
        elif e.type == pygame.KEYDOWN:
            if e.key == pygame.K_ESCAPE or e.key == pygame.K_q:
                break

    pygame.quit()


if __name__ == '__main__':
    main(sys.argv)

